<?php
// 实例化一个http对象
$http = new Swoole\Http\Server('0.0.0.0', 8080);
$http->set([
    'enable_static_handler' => true, // 静态路由支持
    'document_root' => '/home/tan/codes/learnSwoole/server/public' // 静态文件根目录
]);
// 监听请求
$http->on('request', function ($request, $response){
    $param = $request->get;
    $response->header("Token",'qwq');
    $response->cookie("kkkk",'qaq',time()+3600);
    $response->status(201);
    $response->write("hello word");
    $response->write('<br>');
    $response->write(json_encode($param));
    $response->end();
});

$http->start();